package com.cj.pj.sys.service.impl;

import com.cj.pj.sys.dao.SysDeptDao;
import com.cj.pj.sys.pojo.Dept;
import com.cj.pj.sys.service.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Time;
import java.util.Date;
import java.util.List;

@Service
public class SysDeptServiceImpl implements SysDeptService {
    @Autowired
    SysDeptDao sysDeptDao;
    @Override
    public List<Dept> findObject() {
        return sysDeptDao.findObject();
    }

    @Override
    public void insert(Dept dept) {
        Date TimeNow=new Date();
        dept.setCreatedTime(TimeNow);
        dept.setModifiedTime(TimeNow);
        sysDeptDao.insert(dept);
    }

    @Override
    public void updateById(Dept dept) {
        Date TimeNow=new Date();
        dept.setModifiedTime(TimeNow);
        sysDeptDao.updateById(dept);
    }

    @Override
    public void deleteById(Integer id) {
        sysDeptDao.deleteById(id);
    }
}
